#ifndef CHATCLIENT_H
#define CHATCLIENT_H

#include "../KMNetwork/KMNetClient.h"
#include "../KMNetwork/KMNetMsgIn.h"
#include "../KMNetwork/KMNetMsgOut.h"
#include "ChatProtocol.h"
#include "testwx4Main.h"

class KMNetMsgIn;
class KMNetMsgOut;
class testwx4Dialog;

class ChatClient : public KMNetClient
{
public:
    testwx4Dialog* console;

    void sendUserName(const std::string &username)
    {
        KMNetMsgOut msg;
        msg.writeId(CSLOGIN);
        msg.writeString(username);
        KMNetClient::send(msg);
        KMNetClient::update();
    }

protected:
    void processMessageFromServer(KMNetMsgIn &msg);

private:
    std::string mUsername;
};

#endif // CHATCLIENT_H
